home *** CD-ROM | disk | FTP | other *** search
/ Internet 1996 World Exposition / park.org.s3.amazonaws.com.7z / park.org.s3.amazonaws.com / Japan / Panasonic- / funcity / tokyo / tower.dcr / 00001_movie script.ls next >
Encoding:
Text File  |  2017-09-21  |  10.5 KB  |  420 lines

  1. global oncursor, kidobj, diekidnum, getfirenum, firerectslist, fallironmode, lastfalltime, userid, userpw, userpm, userpg, lasteventtime, bamode, jumpmoviename, jumpmode
  2.  
  3. on startMovie
  4.   set oncursor to [the number of cast "onCursor", the number of cast "onCursor" + 1]
  5.   set diekidnum to 0
  6.   set getfirenum to EMPTY
  7.   set fallironmode to 0
  8.   set kidobj to EMPTY
  9.   if not voidp(userid) then
  10.     put userid into field "userID"
  11.   end if
  12.   cursor(oncursor)
  13.   set lasteventtime to the ticks
  14.   set bamode to 0
  15. end
  16.  
  17. on stopMovie
  18.   put "guest" into field "userID"
  19.   put field "addInfoText1" into field "addInfo"
  20.   put 0 into field "label"
  21.   put 0 into field "point"
  22. end
  23.  
  24. on resetcursor
  25.   cursor(oncursor)
  26. end
  27.  
  28. on resetspritecursor
  29.   repeat with s = 1 to 48
  30.     set the cursor of sprite s to 0
  31.   end repeat
  32. end
  33.  
  34. on gameback
  35.   if (the ticks - lasteventtime) > 15 then
  36.     if the frame >= label("ba") then
  37.       nothing()
  38.     else
  39.       if the frame >= label("check") then
  40.         repeat with s = 1 to 48
  41.           set the puppet of sprite s to 0
  42.         end repeat
  43.         go("loop")
  44.       else
  45.         if the frame >= label("help") then
  46.           if objectp(kidobj) then
  47.             set the puppet of sprite clickOn() to 0
  48.             go(label("game") + 1)
  49.           else
  50.             go("loop")
  51.           end if
  52.         else
  53.           if the frame >= label("game") then
  54.             repeat with s = 1 to 48
  55.               set the puppet of sprite s to 0
  56.             end repeat
  57.             go("loop")
  58.           else
  59.             jumpnetmovie("menu.dcr", 0)
  60.           end if
  61.         end if
  62.       end if
  63.     end if
  64.   end if
  65.   set lasteventtime to the ticks
  66. end
  67.  
  68. on gamehelp
  69.   if the frame >= label("ba") then
  70.     exit
  71.   end if
  72.   set the puppet of sprite clickOn() to 0
  73.   go("help")
  74. end
  75.  
  76. on gamequit
  77.   if (the ticks - lasteventtime) > 15 then
  78.     if the frame >= label("ba") then
  79.       exit
  80.     end if
  81.     if the frame >= label("check") then
  82.       jumpnetmovie("menu.dcr", 0)
  83.     else
  84.       set the puppet of sprite clickOn() to 0
  85.       showscore()
  86.     end if
  87.   end if
  88.   set lasteventtime to the ticks
  89. end
  90.  
  91. on jumpnetmovie mname, jmode
  92.   set jumpmoviename to mname
  93.   set jumpmode to jmode
  94.   if userid = "guest" then
  95.     set jumpmode to 1
  96.   end if
  97.   repeat with s = 1 to 48
  98.     set the puppet of sprite s to 0
  99.   end repeat
  100.   if jumpmode then
  101.     gotonetmovie(mname)
  102.   else
  103.     setuserpm()
  104.   end if
  105.   go("move")
  106. end
  107.  
  108. on setuserpm
  109.   getnettext("http://202.224.191.2/cgi-bin/EcOpe.cgi?name=" & userid & "&password=" & userpw & "&amount=" & userpg & "¶meter=" & userpm)
  110. end
  111.  
  112. on checknetresult
  113.   if jumpmode then
  114.     exit
  115.   end if
  116.   if netdone() then
  117.     set nresult to nettextresult()
  118.     if nresult starts "<" then
  119.       alert(deletetag(nresult))
  120.       go("loop")
  121.       abort()
  122.     else
  123.       if nresult starts "E000" then
  124.         if line 1 of nresult = "E0000" then
  125.           set rtext to "Error : Server System Error"
  126.         else
  127.           if line 1 of nresult = "E0001" then
  128.             set rtext to "Error : " & userid & "The name is not registered."
  129.           else
  130.             if line 1 of nresult = "E0002" then
  131.               set rtext to "Error : The password is wrong."
  132.             else
  133.               if line 1 of nresult = "E0003" then
  134.                 set rtext to "Error : The parameter's form is wrong."
  135.               else
  136.                 if line 1 of nresult = "E0003" then
  137.                   set rtext to "Error : Your balance is short - you cannot make a withdrawal."
  138.                 end if
  139.               end if
  140.             end if
  141.           end if
  142.         end if
  143.         alert(rtext)
  144.         go("loop")
  145.         abort()
  146.       else
  147.         set jumpmode to 1
  148.         gotonetmovie(jumpmoviename)
  149.       end if
  150.     end if
  151.   end if
  152. end
  153.  
  154. on deletetag ctext
  155.   repeat while ctext contains "<"
  156.     set fchar to offset("<", ctext)
  157.     set echar to offset(">", ctext)
  158.     delete char fchar to echar of ctext
  159.   end repeat
  160.   return ctext
  161. end
  162.  
  163. on dogame
  164.   stopkid(kidobj)
  165.   falliron()
  166.   rolloverbtn()
  167. end
  168.  
  169. on resetgame
  170.   cursor(4)
  171.   birthkid()
  172.   setfirerects()
  173.   set getfirenum to 0
  174.   set the puppet of sprite 1 to 1
  175.   set lastfalltime to the ticks + (8 * 60)
  176.   set fallironmode to 0
  177.   set diekidnum to 0
  178.   cursor(oncursor)
  179. end
  180.  
  181. on showscore
  182.   put integer(getfirenum * 10) into field "point"
  183.   if getfirenum = 9 then
  184.     put 100 into field "label"
  185.     put field "addInfoText2" into field "addInfo"
  186.   else
  187.     set getlebel to getfirenum
  188.     put integer(getlebel * 10) into field "label"
  189.     put field "addInfoText1" into field "addInfo"
  190.   end if
  191.   put getfirenum into char 11 of userpm
  192.   go("check")
  193. end
  194.  
  195. on birthkid
  196.   set kidobj to birth(script "kid script")
  197. end
  198.  
  199. on turnright
  200.   goright(kidobj)
  201. end
  202.  
  203. on turnleft
  204.   goleft(kidobj)
  205. end
  206.  
  207. on turnup
  208.   goup(kidobj)
  209. end
  210.  
  211. on turndown
  212.   godown(kidobj)
  213. end
  214.  
  215. on hanm
  216.   checkfire(kidobj)
  217. end
  218.  
  219. on rolloverbtn
  220.   set rcnum to the mouseCast
  221.   if rcnum > 0 then
  222.     set rcname to string(the name of cast rcnum)
  223.     if item 2 of rcname = "off" then
  224.       repeat with s = 36 to 43
  225.         if the castNum of sprite s = rcnum then
  226.           set the puppet of sprite s to 1
  227.           set the castNum of sprite s to rcnum + 1
  228.           next repeat
  229.         end if
  230.         set the puppet of sprite s to 0
  231.       end repeat
  232.     else
  233.       if item 2 of rcname = "on" then
  234.         repeat with s = 36 to 43
  235.           if the castNum of sprite s = rcnum then
  236.             if the mouseDown and (clickOn() = s) then
  237.               set the castNum of sprite s to rcnum + 1
  238.               updateStage()
  239.               do(item 1 of rcname)
  240.             end if
  241.           end if
  242.         end repeat
  243.       else
  244.         if item 2 of rcname = "click" then
  245.           repeat with s = 36 to 43
  246.             if the castNum of sprite s = rcnum then
  247.               if the mouseUp then
  248.                 set the castNum of sprite s to rcnum - 1
  249.                 next repeat
  250.               end if
  251.               do(item 1 of rcname)
  252.             end if
  253.           end repeat
  254.         else
  255.           repeat with s = 36 to 43
  256.             set the puppet of sprite s to 0
  257.           end repeat
  258.         end if
  259.       end if
  260.     end if
  261.   else
  262.     repeat with s = 36 to 43
  263.       set the puppet of sprite s to 0
  264.     end repeat
  265.   end if
  266. end
  267.  
  268. on getkidmovewidth tlv
  269.   if tlv <= 155 then
  270.     set rw to 334
  271.     set lw to 118
  272.   else
  273.     if tlv <= 281 then
  274.       set rw to 278 + integer((1 - ((tlv - 155) / float(281 - 155))) * (334 - 278))
  275.       set lw to 168 - integer((1 - ((tlv - 155) / float(281 - 155))) * (168 - 118))
  276.     else
  277.       if tlv <= 359 then
  278.         set rw to 260 + integer((1 - ((tlv - 281) / float(359 - 281))) * (278 - 260))
  279.         set lw to 194 - integer((1 - ((tlv - 281) / float(359 - 281))) * (194 - 168))
  280.       else
  281.         if tlv <= 575 then
  282.           set rw to 232 + integer((1 - ((tlv - 359) / float(575 - 359))) * (260 - 232))
  283.           set lw to 220 - integer((1 - ((tlv - 359) / float(575 - 359))) * (220 - 194))
  284.         else
  285.           if tlv <= 675 then
  286.             set rw to 232
  287.             set lw to 220
  288.           else
  289.             set rw to 228
  290.             set lw to 224
  291.           end if
  292.         end if
  293.       end if
  294.     end if
  295.   end if
  296.   return rw & "," & lw
  297. end
  298.  
  299. on setfirerects
  300.   set firerectslist to []
  301.   repeat with l = 1 to 12
  302.     addrandomrect(285, 358)
  303.   end repeat
  304.   repeat with l = 13 to 20
  305.     addrandomrect(359, 576)
  306.   end repeat
  307.   addrandomrect(577, 671)
  308. end
  309.  
  310. on addrandomrect slv, mlv
  311.   repeat with r = 1 to 10
  312.     set rv to random(mlv - 4 - (slv + 4)) + (slv + 4)
  313.     set rh to random(integer(item 1 of getkidmovewidth(rv)) - 4 - (integer(item 2 of getkidmovewidth(rv)) + 4)) + integer(item 2 of getkidmovewidth(rv)) + 4
  314.     set newrect to rect(rh - 10, rv - 10, rh + 10, rv + 10)
  315.     set rectcheck to 1
  316.     if count(firerectslist) > 0 then
  317.       repeat with l = 1 to count(firerectslist)
  318.         if intersect(getAt(firerectslist, l), newrect) <> rect(0, 0, 0, 0) then
  319.           set rectcheck to 0
  320.           exit repeat
  321.         end if
  322.       end repeat
  323.     end if
  324.     if rectcheck then
  325.       add(firerectslist, newrect)
  326.       exit
  327.     end if
  328.   end repeat
  329. end
  330.  
  331. on checkfirerect
  332.   repeat with l = 1 to count(firerectslist)
  333.     if inside(the loc of sprite 1, getAt(firerectslist, l)) then
  334.       if (the locV of sprite 1 > 370) and not bamode and (random(2) = 1) then
  335.         set bamode to 1
  336.         go("ba")
  337.         puppetSound("tutumi")
  338.       else
  339.         getfire()
  340.         deleteAt(firerectslist, l)
  341.       end if
  342.       exit
  343.     end if
  344.   end repeat
  345. end
  346.  
  347. on getfire
  348.   set the type of sprite 4 to 1
  349.   set the castNum of sprite 4 to the number of cast "fire"
  350.   set the ink of sprite 4 to 36
  351.   set the foreColor of sprite 4 to 255
  352.   set the backColor of sprite 4 to 0
  353.   set the locH of sprite 4 to 260
  354.   set the locV of sprite 4 to 125
  355.   updateStage()
  356.   puppetSound("fanfare")
  357.   repeat with l = 1 to 2
  358.     repeat with s = 37 to 40
  359.       set bname to item 1 of the name of cast the castNum of sprite s
  360.       set the castNum of sprite s to the number of cast (bname & ",click")
  361.       updateStage()
  362.       wait(2)
  363.       set the castNum of sprite s to the number of cast (bname & ",off")
  364.       updateStage()
  365.     end repeat
  366.   end repeat
  367.   set getfirenum to getfirenum + 1
  368.   set the puppet of sprite (18 + getfirenum) to 1
  369.   set the ink of sprite (18 + getfirenum) to 36
  370.   set the blend of sprite (18 + getfirenum) to 100
  371.   if getfirenum >= 9 then
  372.     showscore()
  373.   end if
  374. end
  375.  
  376. on setfalliron
  377.   set fallironmode to random(2) + 5
  378.   set the puppet of sprite fallironmode to 1
  379.   set the locV of sprite fallironmode to -40
  380.   set the locH of sprite fallironmode to 232 + (integer(((12 - getfirenum) * 2.59999999999999964) + random(12)) * (1 - (2 * (random(2) = 1))))
  381.   puppetSound(3, the number of cast "fall")
  382. end
  383.  
  384. on falliron
  385.   if fallironmode = 0 then
  386.     if (the ticks - lastfalltime) > (2 * 60) then
  387.       setfalliron()
  388.       set lastfalltime to the ticks + random(120) + ((9 - getfirenum) * 40)
  389.     end if
  390.     exit
  391.   end if
  392.   set ksnum to the snum of kidobj
  393.   set kloch to the locH of sprite ksnum
  394.   set ktop to the top of sprite ksnum
  395.   if inside(the loc of sprite fallironmode, rect(kloch - 35, ktop - 5, kloch + 25, ktop + 10)) and (the cnum of kidobj <> the number of cast "kid_fall") then
  396.     puppetSound("hit")
  397.     set lastfalltime to the ticks + random(20 * 60)
  398.     updateStage()
  399.     wait(8)
  400.     setfallkid(kidobj)
  401.   else
  402.     if the cnum of kidobj <> the number of cast "kid_fall" then
  403.       set the locV of sprite fallironmode to the locV of sprite fallironmode + 8
  404.     end if
  405.   end if
  406.   if (the locV of sprite fallironmode - the bottom of sprite 1) > 10 then
  407.     set the locV of sprite fallironmode to -40
  408.     set fallironmode to 0
  409.   end if
  410. end
  411.  
  412. on wait wticks
  413.   set stime to the ticks
  414.   repeat while 1
  415.     if (the ticks - stime) >= wticks then
  416.       exit repeat
  417.     end if
  418.   end repeat
  419. end
  420.